﻿<link href="~/SiteUI/Base.css" rel="stylesheet" />

<div class="LoadingBox">
    <div class="loading"></div>
    <h4>正在努力加载...</h4>
</div>

<div class="Waiting">
    <div class="bounce1"></div>
    <div class="bounce2"></div>
    <div class="bounce3"></div>
    <div class="bounce4"></div>
</div>

<script>

    //项目选择控件中的项目信息视图控件
    function ProjViewForSlctor(_srcElm, _opt) {
        Controller.call(this, _srcElm, _opt);
        var instance = this;
        instance.af_setValue = function (_obj) {
            instance._member.$rootElm.text(_obj.Name);
        };
        ProjViewForSlctor.constructor = ProjViewForSlctor;
        return this;
    }
    ProjViewForSlctor.prototype = Controller.prototype;

    $(function () {
        Env.aniLoading = $(".LoadingBox").hide();
        Env.aniWaiting = $(".Waiting").hide();
        Env.aniSaving = $("<div>").addClass('SavingBox saving');

        //创建可用项目弹出菜单
        Env.mnuUserProjs = new PopMenu();
        var lstProjs = new List(null, { ShowHead: false, ShowFoot: false, Selectble: true });
        lstProjs.af_makeView = function (_data) {
            return new ProjViewForSlctor().addClass('ProjectView').val(_data);
        };
        Env.mnuUserProjs.Menu(lstProjs, "itemSlcted");

        //处理常用登记人菜单
        Env.mnuProposers = new PopMenu({ MenuOffset: { top: 2 } });
        var lstProposers = new List(null, { ShowHead: false, ShowFoot: false, Selectble: true, Overflow: 'auto',ShowNullTip:false });
        lstProposers.af_makeView = function (_data) {
            return $('<span>').addClass('proposerItem').text(_data);
        };
        function getKey() {
            var k = $("#txbProposer").val();
            if (!ObjHelper.IsEmpty(k)) {
                k = k.trim();
            }
            return k;
        };
        function predicate(key, data) {
            return ObjHelper.IsEmpty(key) || data.indexOf(key) > -1;
        };
        lstProposers.Filter(getKey, predicate);
        lstProposers.on('show', lstProposers.Filter);
        Env.mnuProposers.Menu(lstProposers, "itemSlcted");
    })
</script>
